/*    */ package btsm.servlet;
/*    */ 
/*    */ import btsm.bean.sqlBTSWork;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintStream;
/*    */ import javax.servlet.RequestDispatcher;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServlet;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ 
/*    */ public class ser_acdc extends HttpServlet
/*    */ {
/*    */   public void init()
/*    */     throws ServletException
/*    */   {
/*    */   }
/*    */ 
/*    */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*    */     throws ServletException, IOException
/*    */   {
/* 19 */     sqlBTSWork PC = new sqlBTSWork("acdcdistribution", "1");
/*    */ 
/* 21 */     String seraction = request.getParameter("seraction");
/* 22 */     String strbtscode = request.getParameter("btscode");
/* 23 */     String strbtsname = request.getParameter("btsname");
/* 24 */     String strsnid = request.getParameter("snid");
/* 25 */     String strToPage = request.getParameter("ToPage");
/* 26 */     if (strToPage == null) {
/* 27 */       strToPage = request.getParameter("tToPage");
/*    */     }
/*    */ 
/* 30 */     System.out.println("传输serBF：btsname:" + strbtsname);
/* 31 */     strbtsname = new String(strbtsname.getBytes("ISO8859-1"), "UTF-8");
/* 32 */     System.out.println("传输serEF中：btsname:" + strbtsname);
/*    */ 
/* 34 */     request.setAttribute("btscode", strbtscode);
/* 35 */     request.setAttribute("btsname", strbtsname);
/*    */ 
/* 37 */     String filesnames = request.getParameter("filesnames");
/*    */ 
/* 39 */     String msg = "";
/* 40 */     String strRedURL = "common.jsp";
/*    */ 
/* 43 */     if (seraction.equalsIgnoreCase("serinsertsimple"))
/*    */     {
/* 45 */       if (PC.insertsimple(strbtscode, strbtsname))
/* 46 */         msg = "新建交直流配电成功";
/*    */       else
/* 48 */         msg = "新建交直流配电失败";
/*    */     }
/* 50 */     else if (seraction.equalsIgnoreCase("sermodp")) {
/* 51 */       request.setAttribute("snid", strsnid);
/* 52 */       if (strToPage == null)
/* 53 */         strToPage = "1";
/* 54 */       strRedURL = "nnmd_acdc.jsp?ToPage=" + strToPage + "&btsname=" + strbtsname;
/* 55 */     } else if (seraction.equals("serdel")) {
/* 56 */       if (PC.delbyid(strsnid))
/* 57 */         msg = "交直流配电信息删除成功";
/*    */       else {
/* 59 */         msg = "交直流配电删除失败";
/*    */       }
/* 61 */       strsnid = "";
/* 62 */     } else if (seraction.equals("sermod")) {
/* 63 */       String[] fieldxg = request.getParameterValues("T1");
/* 64 */       if (PC.mdByID(fieldxg, strsnid))
/* 65 */         msg = "交直流配电信息修改成功";
/*    */       else {
/* 67 */         msg = "交直流配电修改失败";
/*    */       }
/*    */     }
/* 70 */     PC.dbConClose();
/* 71 */     String filesnamesmd = "ser_acdc?seraction=sermodp&btscode=" + strbtscode + "&btsname=" + strbtsname + "&filesnames=" + filesnames + "&snid=" + strsnid + "&ToPage=" + strToPage;
/* 72 */     request.setAttribute("filesnames", filesnamesmd);
/* 73 */     request.setAttribute("msg", msg);
/* 74 */     RequestDispatcher btsm = request.getRequestDispatcher(strRedURL);
/* 75 */     btsm.forward(request, response);
/*    */   }
/*    */ 
/*    */   public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
/*    */   {
/* 80 */     doGet(request, response);
/*    */   }
/*    */ 
/*    */   public void destroy()
/*    */   {
/*    */   }
/*    */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     btsm.servlet.ser_acdc
 * JD-Core Version:    0.6.2
 */